var gh_domain = {
     
    toSSLed:function(url, domain) {
        // http://*.google.com -> https://*.google.com
		// http://*.google.cn  -> https://*.google.cn
        return "https://"+ domain;
    },
     
    isGooglePage:function(domain){
        if(domain == ""){
            return false;
        }
        if(domain.indexOf("google.com") != -1 ||
		   domain.indexOf("google.cn") != -1) {
            return true;
        }
        return false;
    }
};
 
if(gh_domain.isGooglePage(document.domain)){
    chrome.extension.sendRequest({href: gh_domain.toSSLed(location.href, document.domain)});
}